<template>
  <svg :style="{ width, height }">
    <use :fill="color" :xlink:href="prefix + name"></use>
  </svg>
</template>
<script lang="ts" setup>
//接受父组件传递过来的参数
defineProps({
  prefix: {
    type: String,
    default: '#icon-',
  },
  name: String,
  color: {
    type: String,
    default: '',
  },
  width: {
    type: String,
    default: '30px',
  },
  height: {
    type: String,
    default: '30px',
  },
})
</script>
<style lang="scss" scoped></style>
